
(define (:macro sset+ a b) `(setf ,a (concatenate 'string ,a ,b)))
(define (:macro sset+s a b) `(setf ,a (concatenate 'string ,a (format nil "~a" ,b))))
(define (:macro sset+l a b) `(setf ,a (concatenate 'list ,a ,b)))


(define (template-def r-str t-str)
    (let ((d-str nil)(len (length t-str))(c nil)(c1 nil)(res-list nil)(cur-list (get-par-in-str t-str))(par-list (read-from-string r-str)))
      (travel t-str 'for-index i
	      (setf c (char t-str i))
	      (if (< (1+ i) len) (setf c1 (char t-str (1+ i))) (return))
	      (cond ((char= c #\\) (sset+ d-str (string c1))(setf i (1+ i)))
		    ((char= c #\&)
		     (setf res-list (and-func-handle t-str i par-list cur-list))
		     (sset+ d-str (car res-list))
		     (setf i (cadr res-list)))
		     	    
		    (t (sset+ d-str (string c)))))
      d-str))
(define (and-func-handle s n pl cl)
    (let ((num nil)(len (length s))(c nil)(res-list nil)(i n))
      (loop (when (>= i len) (return))
	 (setf c (char s i))
	 
		     
